home *** CD-ROM | disk | FTP | other *** search
- onClipEvent(enterFrame){
- if(_visible)
- {
- dx = _level0.hero._x - _X;
- dy = _level0.hero._y - _Y;
- if(sost == 0)
- {
- dlen = Math.sqrt(dx * dx + dy * dy);
- dx *= (speed + _level0.monster_clock1.ghost_count * 2) / dlen;
- dy *= (speed + _level0.monster_clock1.ghost_count * 2) / dlen;
- var found = false;
- i = 1;
- while(i <= _level0.monster_clock1.ghost_count)
- {
- if("/monster_ghost" + i != _target)
- {
- if(_X + dx + 15 >= eval("_level0.monster_ghost" + i)._x - 15 && _X + dx - 15 <= eval("_level0.monster_ghost" + i)._x + 15 && (_Y + dy + 12 >= eval("_level0.monster_ghost" + i)._y - 12 && _Y + dy - 12 <= eval("_level0.monster_ghost" + i)._y + 12))
- {
- found = true;
- break;
- }
- }
- i++;
- }
- if(!found)
- {
- _X = _X + dx;
- _Y = _Y + dy;
- }
- }
- else
- {
- dx = _level0.hero._x - _X;
- dy = _level0.hero._y - _Y;
- dlen = Math.sqrt(dx * dx + dy * dy);
- _X = _X - dx * 16 / dlen;
- _Y = _Y - dy * 16 / dlen;
- if(_X < 0 || _X > 800 || (_Y < 0 || _Y > 560))
- {
- this.removeMovieClip();
- }
- }
- if(sost == 0 && !_level0.hero.immortal && (_level0.hero.sost == 1 || _level0.hero.sost == 2 || _level0.hero.sost == 3) && (_X + 15 >= _level0.hero._x - 27 && _X - 15 <= _level0.hero._x + 25) && (_Y + 12 >= _level0.hero._y - 8 && _Y - 12 <= _level0.hero._y + 28))
- {
- _level0.hero.sost = 9;
- _level0.hero.death_index = 0;
- _level0.hero._xscale = _xscale;
- _level0.hero.gotoAndPlay(_level0.hero.frame_death);
- }
- }
- }
-